﻿package control
{
    import cmd.*;
    import com.adobe.serialization.json.*;
    import com.core.*;
    import com.sh.game.global.*;
    import com.sh.game.net.*;
    import consts.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.net.*;
    import flash.utils.*;
    import manager.*;
    import plugin.NewSkill.consts.*;
    import plugin.accomplishment.consts.*;
    import plugin.active.*;
    import plugin.bagN.*;
    import plugin.fashen.model.*;
    import plugin.fcactivity.*;
    import plugin.juezhan.model.*;
    import plugin.roleN.model.*;
    import plugin.social.consts.*;
    import plugin.wing.component.*;
    import pluginfw.nio.*;
    import view.*;
    import view.controller.*;
    import view.prompt.*;

    public class MainUIControl extends Control
    {
        private var _init:Boolean = false;
        private var _timeoutID:int = 0;
        private var _instances:Object = null;
        private var _curmapid:int = 0;
        private var _lastAutoBuy:int = 0;
        private var _showExpAdd:Boolean = false;
        private var _mbExpAdd:Boolean = false;
        private var output:Output;
        private var loader:URLLoader;
        private var timer:Timer;
        private var curTime:int;
        private var _intvalID:uint;
        private var _lastHour:int;
        private var _curday:int = 0;
        private var flag:Boolean = false;

        public function MainUIControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            var _loc_3:Object = null;
            var _loc_4:int = 0;
            var _loc_5:Object = null;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:Boolean = false;
            var _loc_9:Object = null;
            var _loc_10:Object = null;
            var _loc_11:Object = null;
            var _loc_12:Object = null;
            var _loc_13:int = 0;
            var _loc_14:Object = null;
            var _loc_15:Date = null;
            var _loc_16:Object = null;
            var _loc_17:String = null;
            var _loc_18:Array = null;
            var _loc_19:Array = null;
            var _loc_20:Array = null;
            var _loc_21:Date = null;
            var _loc_22:Date = null;
            var _loc_23:Date = null;
            var _loc_24:Object = null;
            var _loc_25:Object = null;
            var _loc_26:int = 0;
            var _loc_27:String = null;
            var _loc_28:URLRequest = null;
            var _loc_29:int = 0;
            var _loc_30:int = 0;
            var _loc_31:int = 0;
            var _loc_32:Object = null;
            var _loc_33:Object = null;
            var _loc_34:int = 0;
            var _loc_35:Array = null;
            var _loc_36:Object = null;
            var _loc_37:Object = null;
            var _loc_38:Object = null;
            var _loc_39:int = 0;
            var _loc_40:Object = null;
            var _loc_41:Object = null;
            var _loc_42:Object = null;
            var _loc_43:Object = null;
            var _loc_44:Object = null;
            var _loc_45:Object = null;
            var _loc_46:Object = null;
            var _loc_47:Object = null;
            var _loc_48:Object = null;
            var _loc_49:Array = null;
            if (param1.getName() == "systemset")
            {
                if (param2.property == "guaji")
                {
                    this.target.showAutoBattle(param2.newvalue);
                }
            }
            else if (param1.getName() == "mainui")
            {
                if (param2.property == "showHorn")
                {
                    if (this.target._horn)
                    {
                        this.target._horn.addHorn(param2.newvalue);
                    }
                }
                else if (param2.property == "chatScale")
                {
                    this.target.doChatChange(param2.newvalue);
                }
                else if (param2.property == "checkXunbaoShop")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.checkXunbaoshop();
                    }
                }
                else if (param2.property == "updateTemptation")
                {
                    if (this.target._temptation)
                    {
                        this.target._temptation.update();
                    }
                }
                else if (param2.property == "checkDrug")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.setYaoShuiCount();
                    }
                }
                else if (param2.property == "checkYuanBao")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.checkYuanBao();
                    }
                }
                else if (param2.property == "showClearance")
                {
                    this.target.showClearance();
                }
                else if (param2.property == "flytdEff")
                {
                    this.target.flytdEff(param2.newvalue);
                }
                else if (param2.property == "updateTdStart")
                {
                    this.target.updateTdStart(param2.newvalue);
                }
                else if (param2.property == "changePromptPos")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.setVPos(param2.newvalue);
                    }
                }
                else if (param2.property == "showemail")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.emailRequest(param2.newvalue);
                    }
                }
                else if (param2.property == "closeemail")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.closeEmail();
                    }
                }
                else if (param2.property == "showjiaoyi")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.jiaoyiRequest();
                    }
                }
                else if (param2.property == "addLiehuo")
                {
                    this.target.addLieHuoBuff(param2.newvalue);
                }
                else if (param2.property == "removeLiehuo")
                {
                    this.target.removeLieHuoBuff(param2.newvalue);
                }
                else if (param2.property == "showEffect")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.showEffect(param2.newvalue);
                    }
                }
                else if (param2.property == "bossdatas")
                {
                    _loc_4 = UserData.getUserData("mapid");
                    _loc_6 = ConfigDictionary.data.weizhiandian;
                    for each (_loc_7 in _loc_6)
                    {
                        
                        if (_loc_7.type == _loc_4)
                        {
                            if (_loc_7.showList == 0)
                            {
                                this.target.showBossList(param2.newvalue);
                            }
                        }
                    }
                }
                else if (param2.property == "setUIState")
                {
                    this.target.setUIState(param2.newvalue);
                }
                else if (param2.property == "alert")
                {
                    this.target.showAlert(param2.newvalue);
                }
                else if (param2.property == "smallLoadStart")
                {
                    this.target.smallLoading.start(param2.newvalue);
                }
                else if (param2.property == "smallLoadStop")
                {
                    this.target.smallLoading.end();
                }
                else if (param2.property == "smallLoadProgress")
                {
                    this.target.smallLoading.progress(param2.newvalue);
                }
                else if (param2.property == "autobuypill")
                {
                }
                else if (param2.property == "huodongshow")
                {
                    this.target.huodongshow(param2.newvalue);
                }
                else if (param2.property == "clientWarning")
                {
                    _loc_8 = ModelProxy.getValue("data", "noclientwarning");
                    if (!_loc_8)
                    {
                        DialogMgr.instance.open(AppDialog.JINGBAO, null);
                    }
                }
                else if (param2.property == "showmoney")
                {
                }
                else if (param2.property == "closemoney")
                {
                }
                else if (param2.property == "flyeff")
                {
                    this.target.flyEff(param2.newvalue);
                }
                else if (param2.property == "lianzhipiaoSucceed")
                {
                    this.target.lianzhipiao();
                }
                else if (param2.property == "bigfont")
                {
                    this.target._Bigfint.show(param2.newvalue);
                }
                else if (param2.property == "automove")
                {
                    this.target.showAutoMove(param2.newvalue);
                }
                else if (param2.property == "autoteam")
                {
                }
                else if (param2.property == "SureBuyStore")
                {
                    _loc_9 = param2.newvalue;
                    if (_loc_9 == null)
                    {
                        ModelProxy.change("movetips", "error", "没有找到购买数据");
                    }
                    _loc_10 = ConfigDictionary.data.item[_loc_9[0]];
                    _loc_11 = new Object();
                    _loc_11.icon = _loc_10.icon;
                    _loc_11.name1 = _loc_10.name;
                    _loc_11.nowprice = _loc_9[1];
                    _loc_11.type = _loc_9[2];
                    _loc_11.id = _loc_9[3];
                    DialogMgr.instance.open(AppDialog.SURE_BUY_STORE, _loc_11);
                }
                else if (param2.property == "updaterein")
                {
                    _loc_3 = UserData.getUserData();
                    this.target.power.updatelevel(_loc_3.level);
                    if (this.target.leftTishiView)
                    {
                        this.target.leftTishiView.getLevel();
                    }
                }
                else if (param2.property == "fdsx")
                {
                    this.target.changemain();
                }
                else if (param2.property == "taskeff")
                {
                    this.target.doeffect(param2.newvalue);
                }
                else if (param2.property == "showlvguide")
                {
                    this.target.leftGuide.show(param2.newvalue);
                }
                else if (param2.property == "updatemobaiexp")
                {
                    this.target.mobaiExp.upDateExp(param2.newvalue);
                }
                else if (param2.property == "timePao")
                {
                    _loc_12 = param2.newvalue;
                    this.target.buffView.timePao = _loc_12.flag;
                    if (this._mbExpAdd)
                    {
                        _loc_3 = UserData.getUserData();
                        _loc_4 = _loc_3.mapid;
                        if (_loc_4 == 1027)
                        {
                            if (_loc_12.flag)
                            {
                                this.target.mobaiExp.show(_loc_12.time);
                            }
                            else
                            {
                                this.target.mobaiExp.dipose();
                            }
                        }
                    }
                    else
                    {
                        this.target.mobaiExp.dipose();
                    }
                }
                else if (param2.property == "issafe")
                {
                    this.target.smallMap.unFold(param2.newvalue);
                    _loc_3 = UserData.getUserData();
                    _loc_4 = _loc_3.mapid;
                    if (_loc_4 == 1027)
                    {
                        if (param2.newvalue)
                        {
                            this.target.buffView.showPao(true);
                            this._showExpAdd = true;
                            this._mbExpAdd = true;
                            _loc_13 = int((ModelProxy.getValue("data", "servertime") + Number(getTimer())) / 1000);
                            _loc_14 = ConfigDictionary.data.gameactive;
                            _loc_15 = new Date();
                            _loc_15.setTime(_loc_13 * 1000);
                            _loc_16 = _loc_14[1];
                            _loc_17 = _loc_16.time;
                            _loc_18 = _loc_17.split("-");
                            _loc_19 = (_loc_18[0] as String).split("#");
                            _loc_20 = (_loc_18[1] as String).split("#");
                            _loc_21 = _loc_15;
                            _loc_22 = new Date(_loc_21.fullYear, _loc_21.month, _loc_21.date, int(_loc_19[0]), int(_loc_19[1]), 0, 0);
                            _loc_23 = new Date(_loc_21.fullYear, _loc_21.month, _loc_21.date, int(_loc_20[0]), int(_loc_20[1]), 0, 0);
                            if (_loc_13 >= _loc_22.time / 1000 && _loc_13 <= _loc_23.time / 1000)
                            {
                                this.target.mobaiExp.show(_loc_23.time / 1000 - _loc_13);
                            }
                            else
                            {
                                this.target.mobaiExp.dipose();
                            }
                        }
                        else
                        {
                            this.target.mobaiExp.dipose();
                            this._mbExpAdd = false;
                        }
                    }
                    else if (_loc_4 != 10100)
                    {
                        this.target.buffView.showPao(false);
                        this._mbExpAdd = false;
                        this._showExpAdd = false;
                        this.target.mobaiExp.dipose();
                    }
                    else
                    {
                        this._mbExpAdd = false;
                        target.paoView.close();
                        this.target.mobaiExp.dipose();
                    }
                }
                else if (param2.property == "music")
                {
                    this.target.smallMap.setMusic();
                }
                else if (param2.property == "playemail")
                {
                    this.target.smallMap.playEmail();
                }
                else if (param2.property == "stopemail")
                {
                    this.target.smallMap.stopEmail();
                }
                else if (param2.property == "playactive")
                {
                    this.target.smallMap.playActive();
                }
                else if (param2.property == "stopactive")
                {
                    this.target.smallMap.stopActive();
                }
                else if (param2.property == "playhuoyue")
                {
                    this.target.smallMap.playHuoyue();
                }
                else if (param2.property == "stophuoyue")
                {
                    this.target.smallMap.stopHuoyue();
                }
                else if (param2.property == "playcj")
                {
                    this.target.smallMap.playCj();
                }
                else if (param2.property == "stopcj")
                {
                    this.target.smallMap.stopCj();
                }
                else if (param2.property == "initres")
                {
                }
                else if (param2.property == "initUserInfo")
                {
                    _loc_3 = ModelProxy.getValue("data", "user");
                    UserData.initUser(_loc_3);
                    if (this._init == false)
                    {
                        _loc_27 = Config.gameParams.username;
                        _loc_28 = new URLRequest("api/serverapi.php?request=vjihua&qid=" + _loc_27);
                        this.loader = new URLLoader(_loc_28);
                        this.loader.addEventListener(Event.COMPLETE, this.completeHandler);
                        ModelProxy.change("bufferView", "showBindBuffer", null);
                        ModelProxy.change("fastlist", "refreshSkills", null);
                        this.target.mainFuncView.dataUserUpdate();
                        this.target.taskView.initTask();
                        this.target.power.iniPower();
                        this.target.inituser();
                        this.target._temptation.initSet();
                        PluginManager.instance.sendToServer("online", CMDOnline.GetOnline, null);
                        this.output = new Output();
                        this.output.writeVarInt(6, false);
                        PluginManager.instance.sendToBufferServer("fashion", CMDFashion.Init, this.output);
                        PluginManager.instance.sendToServer("social", CMDSocial.HeiList, null);
                        this.output = new Output();
                        this.output.writeVarInt(2, false);
                        PluginManager.instance.sendToBufferServer("fashion", CMDFashion.Init, this.output);
                        PluginManager.instance.sendToBufferServer("fashen", CMDFaShen.Init, this.output);
                        Server.instance.send(91, CMDJueZhan.TIAN_GUAN_PROGRESS, null);
                        this.output = new Output();
                        PluginManager.instance.sendToBufferServer("kaifujingji", CMDKaifuJJ.AskBossStateInfoMessage, this.output);
                        this._init = true;
                        this.updateAchievement();
                        ModelProxy.change("mainview", "yitiancd", null);
                        if (this.target.mainFuncView && this.target.mainFuncView.menuControl)
                        {
                            this.target.mainFuncView.menuControl.btnNumChange();
                        }
                        PluginManager.instance.sendToServer("bag", CMDBag.Init, null);
                        this.output = new Output();
                        PluginManager.instance.sendToBufferServer("skill", CMDSkill.Refresh, this.output);
                        PluginManager.instance.sendToBufferServer("baoshi", CMDBaoShi.Init, this.output);
                        PluginManager.instance.sendToServer("active", CMDActive.GetOnlineTime, null);
                        PluginManager.instance.sendToServer("wing", CMDWing.Init, null);
                        this.output = new Output();
                        PluginManager.instance.sendToBufferServer("role", CMDRole.AskNeiGongInfo, this.output);
                        this.target.leftGuide.show(_loc_3.level);
                        this.target.buffView.initBuffers(true);
                    }
                    else
                    {
                        ModelProxy.change("plugin", "closefbdrop", null);
                        ModelProxy.change("plugin", "close", "qianghua");
                        ModelProxy.change("mainui", "clearcounter", 0);
                        ModelProxy.change("plugin", "close", "npcdialog");
                        ModelProxy.change("plugin", "close", "zbhsy");
                        ModelProxy.change("plugin", "close", "ems");
                        ModelProxy.change("plugin", "close", "business");
                    }
                    ModelProxy.change("selectView", "clearSelect", null);
                    ModelProxy.change("lianzhan", "close", null);
                    _loc_4 = _loc_3.mapid;
                    _loc_24 = ConfigDictionary.data.wzadMapList;
                    if (_loc_24[_loc_4] == true)
                    {
                        this.output = new Output();
                        this.output.writeVarInt(_loc_4, false);
                        PluginManager.instance.sendToBufferServer("bossChallenge", 5, this.output);
                    }
                    else
                    {
                        this.target.showBossList(null);
                    }
                    if (this._curmapid == 16001)
                    {
                        _loc_29 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                        ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_29, 100), data:{npcid:1098, type:"tafang"}});
                    }
                    if (ConfigDictionary.data.maplist[_loc_4].jingjian == 1 && UIVisibleManager.instance.allState)
                    {
                        UIVisibleManager.instance.Hiddern();
                    }
                    else if (ConfigDictionary.data.maplist[_loc_4].jingjian != 1 && !UIVisibleManager.instance.allState)
                    {
                        UIVisibleManager.instance.Hiddern();
                    }
                    this._curmapid = _loc_4;
                    if (target.mainFuncView)
                    {
                        if (_loc_4 == 1010 || _loc_4 == 1011)
                        {
                            this.target.mainFuncView.menuControl.showDig(true);
                        }
                        else
                        {
                            this.target.mainFuncView.menuControl.showDig(false);
                        }
                    }
                    if (_loc_4 == 1035 && UserData.getUserData("level") > 70)
                    {
                    }
                    else
                    {
                        ModelProxy.change("dazibao", "check", [2, _loc_4]);
                    }
                    if (_loc_4 == 1027 && ModelProxy.getValue("data", "issafe"))
                    {
                        this.target.buffView.showPao(true);
                    }
                    else if (_loc_4 == 10104)
                    {
                        target.paoView.show(false);
                        this._showExpAdd = true;
                    }
                    else
                    {
                        this.target.buffView.showPao(false);
                        this._showExpAdd = false;
                    }
                    if (this._instances == null)
                    {
                        this._instances = ConfigDictionary.data.instance;
                    }
                    _loc_25 = this._instances[_loc_4];
                    if (_loc_25)
                    {
                        _loc_30 = _loc_25.announce;
                        if (_loc_30 > 0)
                        {
                            ModelProxy.change("mainui", "bigfont", [_loc_30]);
                        }
                    }
                    if (this.target.tdRes)
                    {
                        this.target.tdRes.removeResult();
                    }
                    _loc_26 = param2.newvalue.mapid;
                    if (_loc_26 > 10000)
                    {
                        ModelProxy.change("plugin", "close", "instance");
                        ModelProxy.change("plugin", "close", "superinstance");
                        ModelProxy.change("plugin", "close", "tejieshipian");
                        ModelProxy.change("plugin", "close", "csinstance");
                        ModelProxy.change("plugin", "close", "taskinstance");
                        ModelProxy.change("plugin", "close", "role");
                        ModelProxy.change("plugin", "close", "union");
                        ModelProxy.change("multiinstance", "instanceIn", null);
                        this.target.showInstance(true, _loc_26);
                    }
                    else
                    {
                        this.target.showInstance(false);
                    }
                    if (_loc_26 != 1116)
                    {
                        ModelProxy.change("zone", "paoCheck", -2);
                        ModelProxy.change("mainui", "changePao", false);
                    }
                    ModelProxy.change("plugin", "close", "fbcardresult");
                    ModelProxy.change("mainview", "updateGuanZhi", null);
                    ModelProxy.change("fashen", "updateMapID", null);
                }
                else if (param2.property == "showsbk")
                {
                    this.target.showSBKGC(param2.newvalue);
                }
                else if (param2.property == "playvip")
                {
                    this.target.mainFuncView.menuControl.playVip();
                }
                else if (param2.property == "stopvip")
                {
                    this.target.mainFuncView.menuControl.stopVip();
                }
                else if (param2.property == "closesbk")
                {
                    this.target.hideSBKGC();
                }
                else if (param2.property == "powerlevel")
                {
                    this.target.power.updatelevel();
                }
                else if (param2.property == "UpdateAbility")
                {
                    this.target.showPower();
                }
                else if (param2.property == "annouce")
                {
                    this.target.Annouce.showtxt(param2.newvalue);
                }
                else if (param2.property == "notice")
                {
                    if (this.target.notice)
                    {
                        this.target.notice.add(param2.newvalue.data, param2.newvalue.color);
                    }
                }
                else if (param2.property == "annouce1")
                {
                    this.target.announce.add(param2.newvalue);
                }
                else if (param2.property == "annouce2")
                {
                    this.target.Annouce.showtxt2(param2.newvalue);
                }
                else if (param2.property == "newfun")
                {
                }
                else if (param2.property == "showprompt")
                {
                    this.target.prompt.show();
                }
                else if (param2.property == "updaterole")
                {
                    _loc_3 = UserData.getUserData();
                    this.target.showPower();
                    ModelProxy.change("role", "UpdateAbility", int(_loc_3.ability.nbValue) + int(_loc_3.abilityBuf.nbValue));
                }
                else if (param2.property == "checkBagArm")
                {
                    _loc_5 = UserData.getBagData();
                    if (_loc_5 == null)
                    {
                        return;
                    }
                    _loc_31 = 1;
                    while (_loc_31 <= _loc_5.maxcount)
                    {
                        
                        _loc_32 = _loc_5[_loc_31];
                        PowerCheckControl.instance.check(_loc_32);
                        _loc_31++;
                    }
                }
                else if (param2.property == "meiriqd")
                {
                    this.target.activeButtonGroup.openspecialper();
                }
                else if (param2.property == "updateHuoDongEffect")
                {
                    this.target.activeButtonGroup.updateHuoDongEffect(param2.newvalue);
                }
                else if (param2.property == "updaterolelevel")
                {
                    ModelProxy.change("bufferView", "showBindBuffer", null);
                    ModelProxy.change("role", "updateBufferLevel", null);
                    ModelProxy.change("guanwei", "init", null);
                    FCActivityUtil.checkCanGet();
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.updateBtn();
                    }
                    _loc_5 = UserData.getBagData();
                    _loc_33 = UserData.getUserData("level");
                    if (_loc_33 >= 100)
                    {
                        ModelProxy.change("feishen", "huodexiewei", null);
                    }
                    ModelProxy.change("fcactivity", "refresh", null);
                    this.target.power.updatelevel(_loc_33);
                    _loc_34 = 1;
                    while (_loc_34 <= _loc_5.maxcount)
                    {
                        
                        _loc_36 = _loc_5[_loc_34];
                        PowerCheckControl.instance.check(_loc_36);
                        _loc_34++;
                    }
                    if (_loc_33 > 60)
                    {
                        if (this.target.activeButtonGroup)
                        {
                            this.target.activeButtonGroup.checkXunbaoshop();
                        }
                    }
                    if (_loc_33 == 80)
                    {
                        ModelProxy.change("mainview", "updataRein", null);
                    }
                    if (_loc_33 >= 60 && _loc_33 < 65)
                    {
                        _loc_37 = ModelProxy.getValue("data", "option");
                        if (_loc_37.pickupbgold != 1)
                        {
                            ModelProxy.change("zone", "updateOption", {key:"pickupbgold", data:1});
                        }
                        if (_loc_37.pickupgold != 1)
                        {
                            ModelProxy.change("zone", "updateOption", {key:"pickupgold", data:1});
                        }
                    }
                    if (_loc_33 >= 60)
                    {
                        this.target.activeButtonGroup.openspecialper();
                    }
                    ModelProxy.change("dazibao", "check", [8, _loc_33]);
                    if (this.target.mainFuncView)
                    {
                        if (this.target.mainFuncView.menuControl)
                        {
                            this.target.mainFuncView.menuControl.btnNumChange();
                        }
                    }
                    DialogMgr.instance.open(AppDialog.FASHEN_OPEN, null);
                    ModelProxy.change("fashen", "updatelevel", null);
                    ModelProxy.change("qianghua", "updatelevel", null);
                    ModelProxy.change("active", "updatelevel", null);
                    ModelProxy.change("mainview", "updateGuanZhi", null);
                    ModelProxy.change("mainview", "showWingCount", null);
                    ModelProxy.change("suishenshop", "updateLevel", null);
                    ModelProxy.change("mainui", "updateHero", null);
                    ModelProxy.change("mainview", "showBaoshiCount", null);
                    ModelProxy.change("bossChallenge", "updateFBJZ", null);
                    if (this.target._temptation)
                    {
                        this.target._temptation.updateLevel();
                    }
                    _loc_35 = ModelProxy.getValue("data", "jingjitypedata");
                    if (_loc_35 == null)
                    {
                        return;
                    }
                    if (_loc_35[3])
                    {
                        _loc_38 = ConfigDictionary.data.activitygoal;
                        _loc_39 = 0;
                        for each (_loc_40 in _loc_38[3])
                        {
                            
                            _loc_39 = _loc_39 + 1;
                            if (_loc_35[3][0][(_loc_39 - 1)].pkType == 1)
                            {
                                if (_loc_35[3][0][(_loc_39 - 1)].isGet == 0 && _loc_33 >= _loc_40.goal)
                                {
                                    if (_loc_35[3][0][(_loc_39 - 1)].count < _loc_40.count)
                                    {
                                        ModelProxy.change("mainui", "showEffect", {ab:"kaifujingji", state:true});
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                else if (param2.property == "setpkstate")
                {
                    this.target.power.setPkState(int(param2.newvalue));
                }
                else if (param2.property == "initpow")
                {
                }
                else if (param2.property == "counter")
                {
                    this.target.showCounter(param2.newvalue.type, param2.newvalue.value);
                }
                else if (param2.property == "clearcounter")
                {
                    this.target.clearCounter(param2.newvalue);
                }
                else if (param2.property == "changepk")
                {
                    this.target.chanePkModel();
                }
                else if (param2.property == "taskmc")
                {
                    this.target.showTaskMc(param2.newvalue);
                }
                else if (param2.property == "newlogview")
                {
                    this.target.logUI.addNewLog(param2.newvalue);
                }
                else if (param2.property == "logview")
                {
                    if (this.target.logUI)
                    {
                        this.target.logUI.addLog(param2.newvalue);
                    }
                }
                else if (param2.property == "logview2")
                {
                    if (this._showExpAdd)
                    {
                        WarningManager.show(139, ["经验", param2.newvalue]);
                    }
                }
                else if (param2.property == "abilityChange")
                {
                    _loc_41 = param2.newvalue;
                    _loc_42 = UserData.getUserData("ability");
                    this.target._attributeRun.checkAbi(_loc_41, _loc_42);
                }
                else if (param2.property == "getRun")
                {
                    this.target._getRun.addMessage(param2.newvalue.type, param2.newvalue.msgArr);
                }
                else if (param2.property == "getonline")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.initShow();
                    }
                }
                else if (param2.property == "updateBagForActvieBtn")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.updateBag();
                    }
                }
                else if (param2.property == "refreshOnlineBtn")
                {
                    this.target.activeButtonGroup.updateOnline();
                }
                else if (param2.property == "refreshShouChongBtn")
                {
                    this.target.activeButtonGroup.updateShouchong();
                }
                else if (param2.property == "updateBtnGroup")
                {
                    this.target.activeButtonGroup.updateBtnShow(param2.newvalue);
                }
                else if (param2.property == "activetimeshow")
                {
                    this.target.activeButtonGroup.setTimeShow(param2.newvalue);
                }
                else if (param2.property == "showactiveview")
                {
                    this.target.taskView.showActiveView(param2.newvalue);
                }
                else if (param2.property == "changeswf")
                {
                }
                else if (param2.property == "showtask")
                {
                }
                else if (param2.property == "monsteratkinit")
                {
                }
                else if (param2.property == "hidemonsterpanel")
                {
                }
                else if (param2.property == "treasureGet")
                {
                    ModelProxy.change("mainuiInstance", "graveGet", param2.newvalue);
                }
                else if (param2.property == "treasureKeep")
                {
                    ModelProxy.change("mainuiInstance", "graveKeep", param2.newvalue);
                }
                else if (param2.property == "wwdzKill")
                {
                }
                else if (param2.property == "wwdzStart")
                {
                }
                else if (param2.property == "wwdzStartTime")
                {
                }
                else if (param2.property == "wwdzNum")
                {
                }
                else if (param2.property == "wwdzExit")
                {
                }
                else if (param2.property == "smzcNumber")
                {
                    ModelProxy.change("mainuiInstance", "ddKill", param2.newvalue);
                }
                else if (param2.property == "smzcScore")
                {
                    ModelProxy.change("mainuiInstance", "ddScore", param2.newvalue);
                }
                else if (param2.property == "smzcSetMo")
                {
                    this.target.instance.smzcSetMo(param2.newvalue);
                }
                else if (param2.property == "smzcEnter")
                {
                    ModelProxy.change("mainuiInstance", "ddEnter", param2.newvalue);
                }
                else if (param2.property == "smzcEnd")
                {
                    ModelProxy.change("mainuiInstance", "ddEnd", param2.newvalue);
                }
                else if (param2.property == "tdNext")
                {
                    ModelProxy.change("mainuiInstance", "tdNext", param2.newvalue);
                }
                else if (param2.property == "updatetdtime")
                {
                    this.target.updatetdtime();
                }
                else if (param2.property == "tdInfo")
                {
                    ModelProxy.change("mainuiInstance", "tdInfo", param2.newvalue);
                    _loc_43 = {tsize:param2.newvalue.tower[0], tid:0};
                    this.target.updateTDCount(_loc_43);
                    _loc_43 = {tsize:param2.newvalue.tower[1], tid:1};
                    this.target.updateTDCount(_loc_43);
                }
                else if (param2.property == "gettdexp")
                {
                    this.target.gettdexp(param2.newvalue);
                }
                else if (param2.property == "moneytreeinfo")
                {
                    ModelProxy.change("mainuiInstance", "moneytreeinfo", param2.newvalue);
                }
                else if (param2.property == "updateTFbyBag")
                {
                    this.target.updateTDCount(param2.newvalue, 2);
                }
                else if (param2.property == "SuperTF")
                {
                    this.target.updateTDCount(param2.newvalue);
                    if (param2.newvalue)
                    {
                        ModelProxy.change("mainuiInstance", "createSuperTF", param2.newvalue);
                        if (param2.newvalue.tid == 0)
                        {
                            GuideView.getInstance().hide();
                        }
                    }
                }
                else if (param2.property == "tdEnd")
                {
                    this.target.tdEnd(param2.newvalue);
                }
                else if (param2.property == "beginMining")
                {
                }
                else if (param2.property == "endMining")
                {
                }
                else if (param2.property == "resultWindow")
                {
                    this.target.resultWindow(param2.newvalue);
                }
                else if (param2.property == "tdClear")
                {
                    if (this.target.tdRes)
                    {
                        this.target.tdRes.removeResult();
                    }
                }
                else if (param2.property == "updateAchievement")
                {
                    this.target.activeButtonGroup.checkActivity();
                    if (this._timeoutID > 0)
                    {
                        clearTimeout(this._timeoutID);
                    }
                }
                else if (param2.property == "updateGoddess")
                {
                    this.target.activeButtonGroup.checkGoddess();
                }
                else if (param2.property == "checkAchievement")
                {
                    this.checkAchievement(param2.newvalue);
                }
                else if (param2.property == "removeActiveBtn")
                {
                    this.target.removeActiveBtn(param2.newvalue);
                }
                else if (param2.property == "itemEffect")
                {
                    this.target.itemEffect.add(param2.newvalue);
                }
                else if (param2.property == "itemEffect3")
                {
                    this.target.AdditemEffec3(param2.newvalue);
                }
                else if (param2.property == "activeBoradCast")
                {
                    this.activeBoradCast();
                }
                else if (param2.property == "vipChange")
                {
                    this.target.yingdaoView.changeVip();
                }
                else if (param2.property == "horseChange")
                {
                }
                else if (param2.property == "checkRoleExp")
                {
                    this.target.checkEXP(param2.newvalue);
                }
                else if (param2.property == "exitZone")
                {
                    if (param2.newvalue > 10000)
                    {
                    }
                }
                else if (param2.property == "simpleVersion")
                {
                    this.target.simpleVersion = param2.newvalue;
                }
                else if (param2.property == "showTishi")
                {
                }
                else if (param2.property == "activeTime")
                {
                    this.activeTime(int(param2.newvalue));
                }
                else if (param2.property == "stopActiveTime")
                {
                    this.activeTimeStop();
                }
                else if (param2.property == "ringRelive")
                {
                    ModelProxy.change("data", "ringReliveTime", new Date().time);
                    _loc_44 = ModelProxy.getValue("data", "ringdata");
                    if (_loc_44)
                    {
                        _loc_45 = ConfigDictionary.data.rings;
                        for each (_loc_46 in _loc_45)
                        {
                            
                            if (_loc_46.ringid == 6)
                            {
                                if (_loc_46.ringlevel == _loc_44[5])
                                {
                                    _loc_47 = ConfigDictionary.data.ringSkill;
                                    for each (_loc_48 in _loc_47)
                                    {
                                        
                                        if (_loc_48.skillid == _loc_46.level)
                                        {
                                            _loc_49 = _loc_48.bufferparam.split("#");
                                            ModelProxy.change("bufferView", "addItemBuffer", [_loc_48.bufferid, {type:1, id:_loc_48.bufferid, dispelTime:_loc_49[0]}]);
                                            return;
                                        }
                                    }
                                    return;
                                }
                            }
                        }
                    }
                }
                else if (param2.property == "extratl")
                {
                    this.target.xbtime.getStrength();
                }
                else if (param2.property == "addSimpleChator")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.addChatTips(0, param2.newvalue);
                    }
                }
                else if (param2.property == "addUnionChator")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.addChatTips(1, param2.newvalue);
                    }
                }
                else if (param2.property == "addFriendChator")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.addChatTips(2, param2.newvalue);
                    }
                }
                else if (param2.property == "removeChatTips")
                {
                    this.target.promptView.removeChatTips(param2.newvalue);
                }
                else if (param2.property == "killerEmail")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.addChatTips(3, param2.newvalue);
                    }
                }
                else if (param2.property == "closeChator")
                {
                    if (this.target.mainFuncView)
                    {
                        this.target.mainFuncView.changeChatTips(1, param2.newvalue);
                    }
                }
                else if (param2.property == "closingShake")
                {
                    this.target.mainFuncView.menuControl.doShake(param2.newvalue);
                    this.target.activeButtonGroup.doShake(param2.newvalue);
                }
                else if (param2.property == "changeActive")
                {
                    this.target.activeButtonGroup.visible = param2.newvalue;
                }
                else if (param2.property == "addMarquee")
                {
                    this.target.marquee.addToStack(param2.newvalue.type, param2.newvalue.msg);
                }
                else if (param2.property == "SetGuanzhi")
                {
                    ModelProxy.change("guanwei", "SetGuanzhi", param2.newvalue);
                    ModelProxy.change("role", "SetGuanzhi", param2.newvalue);
                    ModelProxy.change("wing", "guanzhi", param2.newvalue);
                    ModelProxy.change("mainview", "updateGuanZhi", null);
                }
                else if (param2.property == "addBtn")
                {
                    this.target.activeButtonGroup.addBtn(param2.newvalue);
                }
                else if (param2.property == "removeBtn")
                {
                    this.target.activeButtonGroup.removeBtn(param2.newvalue);
                }
                else if (param2.property == "removeLeafBtn")
                {
                    this.target.activeButtonGroup.removeLeaf(param2.newvalue);
                }
                else if (param2.property == "initBtnGroup")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.initShow();
                    }
                }
                else if (param2.property == "chuzhanHero")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.chuzhanHero(param2.newvalue);
                    }
                }
                else if (param2.property == "checkMRSCShow")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.checkMRSCShow();
                    }
                }
                else if (param2.property == "showFashen")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.addBtn("fashen");
                    }
                }
                else if (param2.property == "jihuoHero")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.jihuoHero(param2.newvalue);
                    }
                }
                else if (param2.property == "showJihuoHero")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.showJihuoHero(param2.newvalue);
                    }
                }
                else if (param2.property == "updateHero")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.showJiHuoHeros();
                    }
                }
                else if (param2.property == "updatejhz")
                {
                    if (this.target.activeButtonGroup)
                    {
                        this.target.activeButtonGroup.updateJuHunZhu(param2.newvalue);
                    }
                }
                else if (param2.property == "warning")
                {
                    WarningManager.show(int(param2.newvalue));
                }
                else if (param2.property == "zudui")
                {
                    if (this.target.promptView)
                    {
                        this.target.promptView.update(PromptGame.TYPE_TEAM, param2.newvalue);
                    }
                }
                else if (param2.property == "changeUnionEms")
                {
                    this.target.changeEMSState();
                }
                else if (param2.property == "checkEmsMove")
                {
                    this.target.checkEmsMove();
                }
                else if (param2.property == "bmRunAdd")
                {
                    if (this.target._bmRunner)
                    {
                        this.target._bmRunner.show(param2.newvalue.type, param2.newvalue.count);
                    }
                }
                else if (param2.property == "addRongYu")
                {
                    if (this.target.addRongYu)
                    {
                        this.target.addRongYu(param2.newvalue);
                    }
                }
                else if (param2.property == "temptationFaShen")
                {
                    if (this.target._temptation)
                    {
                        this.target._temptation.fashenChange();
                    }
                }
                else if (param2.property == "temptationCheckFaShen")
                {
                    if (this.target._temptation)
                    {
                        this.target._temptation.checkFashen();
                    }
                }
                else if (param2.property == "showNbFly")
                {
                    if (this.target.nbFly)
                    {
                        this.target.nbFly.show(param2.newvalue);
                    }
                }
                else if (param2.property == "changePao")
                {
                    this.target.changePao(param2.newvalue);
                }
                else if (param2.property == "autoEmsEffChange")
                {
                    this.target.changeAutoEmsEff(param2.newvalue);
                }
                else if (param2.property == "showfsguide")
                {
                    this.target.showFaShenGuide();
                }
            }
            else if (param1.getName() == "localCache")
            {
                if (param2.property == "option")
                {
                }
            }
            else if (param1.getName() == "ems")
            {
                if (param2.property == "startEms")
                {
                    this.target.changeEMSState();
                }
                else if (param2.property == "getMyEmsInfo")
                {
                    this.target.changeEMSState();
                }
                else if (param2.property == "EMSFail")
                {
                    this.target.changeEMSState();
                }
                else if (param2.property == "newEMS")
                {
                    this.target.changeEMSState();
                }
                else if (param2.property == "completeEms")
                {
                    this.target.changeEMSState();
                }
            }
            return;
        }// end function

        protected function completeHandler(event:Event) : void
        {
            var _loc_2:Object = null;
            if (this.loader.data)
            {
                _loc_2 = JSONCode.decode(this.loader.data);
                if (_loc_2.errno == 0)
                {
                    if (!_loc_2.data.end_time)
                    {
                        _loc_2.data.end_time = new Object();
                        _loc_2.data.end_time.year_true = _loc_2.data.expire_time.year;
                        _loc_2.data.end_time.month_true = _loc_2.data.expire_time.month;
                        _loc_2.data.end_time.year = _loc_2.data.expire_time.year;
                        _loc_2.data.end_time.month = _loc_2.data.expire_time.month;
                    }
                    ModelProxy.change("data", "vplan", _loc_2.data);
                }
            }
            return;
        }// end function

        private function activeTimeStop() : void
        {
            if (this.timer)
            {
                this.timer.stop();
                this.timer.removeEventListener(TimerEvent.TIMER, this.doTime);
                this.timer = null;
            }
            return;
        }// end function

        private function activeTime(param1:int) : void
        {
            ModelProxy.change("data", "onTime", param1);
            if (param1 > 10800)
            {
                return;
            }
            this.curTime = param1;
            this.timer = new Timer(60000);
            this.timer.addEventListener(TimerEvent.TIMER, this.doTime);
            this.timer.start();
            return;
        }// end function

        protected function doTime(event:TimerEvent) : void
        {
            var _loc_3:int = 0;
            ModelProxy.change("data", "onTime", this.curTime);
            var _loc_2:* = ModelProxy.getValue("data", "ringdata");
            if (_loc_2)
            {
                if (_loc_2[2] < 0)
                {
                    if (_loc_2[1] >= 10)
                    {
                        if (this.curTime > 3600)
                        {
                            _loc_3 = UserData.getUserData("level");
                            if (_loc_3 >= 54)
                            {
                                PluginManager.instance.sendToServer("ring", CMDTJ.GetTJ, {tid:3});
                            }
                        }
                    }
                }
            }
            this.curTime = this.curTime + 60;
            if (this.curTime > 10800)
            {
                PluginManager.instance.sendToServer("active", CMDActive.checkOnline, null);
            }
            return;
        }// end function

        private function activeBoradCast() : void
        {
            var _loc_1:* = new Date();
            var _loc_2:* = _loc_1.hours;
            if (_loc_2 == 0 && this._lastHour == 23)
            {
                var _loc_3:String = this;
                var _loc_4:* = this._curday + 1;
                _loc_3._curday = _loc_4;
            }
            this._lastHour = _loc_2;
            this._intvalID = setInterval(this.testActiveBroad, 600000);
            return;
        }// end function

        private function testActiveBroad() : void
        {
            var _loc_6:Object = null;
            var _loc_7:int = 0;
            var _loc_1:* = new Date();
            var _loc_2:* = _loc_1.hours;
            if (_loc_2 == 0 && this._lastHour == 23)
            {
                var _loc_8:String = this;
                var _loc_9:* = this._curday + 1;
                _loc_8._curday = _loc_9;
            }
            this._lastHour = _loc_2;
            var _loc_3:* = ModelProxy.getValue("data", "openday");
            if (_loc_3 >= 10)
            {
                clearInterval(this._intvalID);
                this._intvalID = 0;
                return;
            }
            var _loc_4:* = ConfigDictionary.data.testactive;
            var _loc_5:* = ConfigDictionary.data.announce;
            for each (_loc_6 in _loc_4)
            {
                
                if (_loc_6.state == (_loc_3 + 1))
                {
                    _loc_7 = _loc_6.broadcast;
                    if (_loc_5[_loc_7])
                    {
                        ModelProxy.change("chat", "addsysmsg", String(_loc_5[_loc_7].text).replace(/\|""\|/gi, ","));
                    }
                }
            }
            return;
        }// end function

        public function checkUnHZC() : void
        {
            var _loc_3:int = 0;
            var _loc_4:Object = null;
            var _loc_5:Boolean = false;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:Object = null;
            var _loc_9:Object = null;
            var _loc_1:Boolean = false;
            var _loc_2:* = ModelProxy.getValue("data", "arms");
            if (_loc_2)
            {
                if (_loc_2[1] && _loc_2[1].itemid == Constant.KUANG_CHU)
                {
                    _loc_1 = true;
                }
            }
            if (_loc_1)
            {
                _loc_3 = ModelProxy.getValue("data", "digarm");
                if (_loc_3 > 0)
                {
                    _loc_4 = UserData.getBagData();
                    _loc_5 = false;
                    if (_loc_4)
                    {
                        for (_loc_7 in _loc_4)
                        {
                            
                            _loc_8 = _loc_4[_loc_7];
                            if (_loc_8[2] == 1 && _loc_8[0] == _loc_3)
                            {
                                _loc_9 = _loc_8[4];
                                if (_loc_9)
                                {
                                    _loc_6 = new Object();
                                    _loc_6.pos = 1;
                                    _loc_6.armid = _loc_8[0];
                                    _loc_6.index = _loc_8.index;
                                    ModelProxy.change("plugin", "sendSysMsg", {name:"role", param:_loc_6, cmd:2});
                                    break;
                                }
                            }
                        }
                    }
                }
                ModelProxy.change("data", "digarm", 0);
            }
            return;
        }// end function

        private function updateAchievement() : void
        {
            this._timeoutID = 0;
            ModelProxy.change("plugin", "sendSysMsg", {name:"achievement", param:0, cmd:CMDAchievement.GetAchievement});
            return;
        }// end function

        private function checkAchievement(param1:Object) : void
        {
            var _loc_7:Array = null;
            var _loc_8:Object = null;
            return;
            if (_loc_6)
            {
                ModelProxy.change("plugin", "sendSysMsg", {name:"achievement", param:0, cmd:CMDAchievement.GetAchievement});
            }
            return;
        }// end function

    }
}
